home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / GXPrinterDrivers.p < prev    next >
Text File  |  1995-09-14  |  37KB  |  826 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 6:50:18 PM }
  2. {}
  3. {     File:        GXPrinterDrivers.p}
  4. { }
  5. {     Contains:    This file defines data types and API functions for printer driver development.}
  6. { }
  7. {     Version:    Technology:    Quickdraw GX 1.1}
  8. {                 Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
  9. { }
  10. {     Copyright:    © 1984-1995 by Apple Computer, Inc.}
  11. {                 All rights reserved.}
  12. { }
  13. {     Bugs?:        If you find a problem with this file, use the Apple Bug Reporter}
  14. {                 stack.  Include the file and version information (from above)}
  15. {                 in the problem description and send to:}
  16. {                     Internet:    apple.bugs@applelink.apple.com}
  17. {                     AppleLink:    APPLE.BUGS}
  18. { }
  19. {}
  20.  
  21. unit GXPrinterDrivers;
  22. interface
  23.  
  24.  
  25. {$IFC UNDEFINED __GXPRINTERDRIVERS__}
  26. {$SETC __GXPRINTERDRIVERS__ := 1}
  27.  
  28.     uses
  29.         ConditionalMacros, Types, Quickdraw, Dialogs, Collections, GXMath, GXTypes, ScalerTypes, Printing, GXPrinting;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35.     type
  36.         gxManualFeedAlertPrefs = record
  37.                 alertFlags: LONGINT;                                {    Flags--first word is for driver's private use, the rest is predefined. }
  38.             end;
  39.  
  40.         gxManualFeedAlertPrefsPtr = ^gxManualFeedAlertPrefs;
  41.         gxManualFeedAlertPrefsHdl = ^gxManualFeedAlertPrefsPtr;
  42.  
  43. { Constants for the alertFlags field of gxManualFeedAlertPrefs.}
  44.  
  45.     const
  46.         gxShowAlerts = $00000001;                    { Show alerts for this desktop printer. }
  47.         gxAlertOnPaperChange = $00000002;                    { …only if the papertype changes. }
  48.  
  49.         gxDefaultMFeedAlertSettings = $3;
  50.  
  51. { Driver output settings structure for desktop printer gxDriverOutputType resource }
  52.  
  53.     type
  54.         gxDriverOutputSettings = record
  55.                 driverflags: LONGINT;                                {    Flags -- for use by driver. }
  56.                 outputSettings: LONGINT;                                {    Flags -- predefined. }
  57.             end;
  58.  
  59.         gxDriverOutputSettingsPtr = ^gxDriverOutputSettings;
  60.         gxDriverOutputSettingsHdl = ^gxDriverOutputSettingsPtr;
  61.  
  62. { Constants for the outputSettings field of gxDriverOutputSettings. }
  63.  
  64.     const
  65.         gxCanConfigureTrays = $00000001;                    { Desktop printer represents a device with a paper feed. }
  66.  
  67. { ------------------------------------------------------------------------------}
  68. {}
  69. {                        Printing Driver Constants and Types}
  70. {}
  71. {-------------------------------------------------------------------------------- }
  72.         gxInputTraysMenuItem = -1;                            { Menu item number for "Input Trays..." }
  73.  
  74. { Buffering and IO preferences-- this structure mirrors the 'iobm' resource }
  75.  
  76.     type
  77.         gxIOPrefsRec = record
  78.                 communicationsOptions: LONGINT;                                { Standard or nonstandard I/O? }
  79.                 numBuffers: LONGINT;                                { Requested number of buffers for QDGX to create }
  80.                 bufferSize: LONGINT;                                { The size of each buffer }
  81.                 numReqBlocks: LONGINT;                                { The number of async I/O request blocks which will be needed }
  82.                 openCloseTimeout: LONGINT;                                { The open/close timeout (in ticks) }
  83.                 readWriteTimeout: LONGINT;                                { The read/write timeout (in ticks) }
  84.             end;
  85.  
  86.         gxIOPrefsPtr = ^gxIOPrefsRec;
  87.         gxIOPrefsHdl = ^gxIOPrefsPtr;
  88.  
  89. { Constants for the communicationsOptions field of IOPrefsRec. }
  90.  
  91.     const
  92.         gxUseCustomIO = $00000001;                    { Driver uses a non-standard IO mechanism }
  93.  
  94. { Information about writing to a file }
  95.  
  96.     type
  97.         gxPrintDestinationRec = record
  98.                 printToFile: BOOLEAN;                                { True if output is to go to a file }
  99.                 padByte: CHAR;
  100.                 fSpec: FSSpec;                                    { If going to a file, the FSSpec for the file }
  101.                 includeFonts: CHAR;                                    { True if fonts are to be included }
  102.                 fileFormat: Str31;                                    { Format to write file }
  103.             end;
  104.  
  105.         gxPrintDestinationPtr = ^gxPrintDestinationRec;
  106.         gxPrintDestinationHdl = ^gxPrintDestinationPtr;
  107.  
  108. { This structure is the content of each cell in the standard PACK LDEF }
  109.         gxPortListRec = record
  110.                 firstMarker: CHAR;                                    { Markers to indicate icon or non-icon version }
  111.                 secondMarker: CHAR;                                    { if these are ≈ and ≈, then the cell is an icon cell. }
  112.         { Otherwise, it is assumed to be a standard text LDEF }
  113.         { cell }
  114.                 iconSuiteHandle: Handle;                                    { The icon suite to draw for this cell }
  115.                 outputDriverName: Handle;                                    { Handle to the output driver name (for serial) }
  116.                 inputDriverName: Handle;                                    { Handle to the input driver name (for serial) }
  117.                 iconName: Str255;                                    { Name to draw under the icon }
  118.             end;
  119.  
  120.         gxPortListPtr = ^gxPortListRec;
  121.  
  122. { ------------------------------------------------------------------------------}
  123. {}
  124. {                        Printing Driver Constants for resources in the desktop printer}
  125. {}
  126. {-------------------------------------------------------------------------------- }
  127.  
  128.     const
  129.         gxDeviceCommunicationsID = 0;
  130.  
  131. { ----------------------------------• 'prod' •---------------------------------- }
  132. {}
  133. {      For PostScript devices, the device and version names of the device.}
  134. {      (0) product name is of type PString}
  135. {      (1) version is of type PString}
  136. {      (2) revision is of type PString}
  137. {      (3) vm available is of type long}
  138. {      (4) font stream type is of type scalerStreamTypeFlag}
  139. {      (5) language level is of type long}
  140. {}
  141.         gxPostscriptProductInfoType = 'prod';
  142.         gxPostscriptProductNameID = 0;
  143.         gxPostscriptVersionID = 1;
  144.         gxPostscriptRevisionID = 2;
  145.         gxPostscriptVMAvailableID = 3;
  146.         gxPostscriptFontStreamTypeID = 4;
  147.         gxPostscriptLanguageLevelID = 5;
  148.  
  149. { ------------------------------------------------------------------------------}
  150. {}
  151. {                        Printing Driver Constants for status alerts}
  152. {}
  153. {-------------------------------------------------------------------------------- }
  154. { Structure passed in statusBuffer of StatusRecord for manual feed alert }
  155.  
  156.     type
  157.         gxManualFeedRecord = record
  158.                 canAutoFeed: BOOLEAN;                                { True if driver can switch to auto feed }
  159.                 paperTypeName: Str31;                                    { Name of paperType to feed manually }
  160.             end;
  161.  
  162. { Structure passed in statusBuffer of StatusRecord for out of paper alert }
  163.         gxOutOfPaperRecord = record
  164.                 paperTypeName: Str31;                                    { Name of printing document }
  165.             end;
  166.  
  167. { The DITL id for the auto feed button in the manual feed alert }
  168.  
  169.     const
  170.         gxAutoFeedButtonId = 3;
  171.  
  172. { Status resource id for the alerts }
  173.         gxUnivAlertStatusResourceId = -28508;
  174.  
  175. { Status resource indices for alerts }
  176.         gxUnivManualFeedIndex = 2;
  177.         gxUnivFailToPrintIndex = 3;
  178.         gxUnivPaperJamIndex = 4;
  179.         gxUnivOutOfPaperIndex = 5;
  180.         gxUnivNoPaperTrayIndex = 6;
  181.         gxUnivPrinterReadyIndex = 7;
  182.         gxUnivAlertBeforeIndex = 9;
  183.         gxUnivAlertAfterIndex = 10;
  184.  
  185. { Allocation sizes for status buffers needed for automatic alerts }
  186.         gxDefaultStatusBufferSize = 10;
  187.         gxManualFeedStatusBufferSize = 34;
  188.         gxOutOfPaperStatusBufferSize = 42;
  189.  
  190. { ------------------------------------------------------------------------------}
  191. {}
  192. {                                Old Application Support}
  193. {}
  194. {-------------------------------------------------------------------------------- }
  195. { The format of a 'cust' resource  }
  196.  
  197.     type
  198.         gxCustomizationRec = record
  199.                 horizontalResolution: INTEGER;                                { Horizontal res (integral part) }
  200.                 verticalResolution: INTEGER;                                { Vertical res (integral part) }
  201.                 upDriverType: INTEGER;                                { "upDriver" emulation type }
  202.                 patternStretch: Point;                                    { Pattern stretch factor }
  203.                 translatorSettings: INTEGER;                                { Translator settings to use }
  204.             end;
  205.  
  206.         gxCustomizationPtr = ^gxCustomizationRec;
  207.         gxCustomizationHdl = ^gxCustomizationPtr;
  208.  
  209. { The format of a 'resl' resource }
  210.         gxResolutionRec = record
  211.                 rangeType: INTEGER;                                { Always 1 }
  212.                 xMinimumResolution: INTEGER;                                { Min X resolution available }
  213.                 xMaximumResolution: INTEGER;                                { Max X resolution available }
  214.                 yMinimumResolution: INTEGER;                                { Min Y resolution available }
  215.                 yMaximumResolution: INTEGER;                                { Max Y resolution available }
  216.                 resolutionCount: INTEGER;                                { Number of resolutions }
  217.                 resolutions: array[0..0] of Point;                    { Array of resolutions }
  218.             end;
  219.  
  220.         gxResolutionPtr = ^gxResolutionRec;
  221.         gxResolutionHdl = ^gxResolutionPtr;
  222.  
  223. {}
  224. {}
  225. {        Constants for the "universal" print record.}
  226. {}
  227. {}
  228. { Constant for version number in universal print record }
  229.  
  230.     const
  231.         gxPrintRecordVersion = 8;
  232.  
  233. { Constants for feed field in universal print record }
  234.         gxAutoFeed = 0;
  235.         gxManualFeed = 1;
  236.  
  237. { Constants for options field in universal print record }
  238.         gxPreciseBitmap = $0001;                        { Tall adjusted (IW), precise bitmap (LW, SC) }
  239.         gxBiggerPages = $0002;                        { No gaps (IW), larger print area (LW) }
  240.         gxGraphicSmoothing = $0004;                        { Graphic smoothing (LW) }
  241.         gxTextSmoothing = $0008;                        { Text smoothing (SC) }
  242.         gxFontSubstitution = $0010;                        { Font substitution }
  243.         gxInvertPage = $0020;                        { B/W invert image }
  244.         gxFlipPageHoriz = $0040;                        { Flip horizontal }
  245.         gxFlipPageVert = $0080;                        { Flip vertical }
  246.         gxColorMode = $0100;                        { Color printing }
  247.         gxBidirectional = $0200;                        { Bidirectional printing }
  248.         gxUserFlag0 = $0400;                        { User flag 0 }
  249.         gxUserFlag1 = $0800;                        { User flag 1 }
  250.         gxUserFlag2 = $1000;                        { User flag 2 }
  251.         gxReservedFlag0 = $2000;                        { Reserved flag 0 }
  252.         gxReservedFlag1 = $4000;                        { Reserved flag 1 }
  253.         gxReservedFlag2 = $8000;                        { Reserved flag 2 }
  254.  
  255. { Constants for orientation field in universal print record }
  256.         gxPortraitOrientation = 0;
  257.         gxLandscapeOrientation = 1;
  258.         gxAltPortraitOrientation = 2;
  259.         gxAltLandscapeOrientation = 3;
  260.  
  261. { Constants for qualityMode field in universal print record }
  262.         gxBestQuality = 0;
  263.         gxFasterQuality = 1;
  264.         gxDraftQuality = 2;
  265.  
  266. { Constants for firstTray and remainingTray fields in universal print record }
  267.         gxFirstTray = 0;
  268.         gxSecondTray = 1;
  269.         gxThirdTray = 2;
  270.  
  271. { Constants for coverPage field in universal print record }
  272.         gxNoCoverPage = 0;
  273.         gxFirstPageCover = 1;
  274.         gxLastPageCover = 2;
  275.  
  276. { Constants for headMotion field in universal print record }
  277.         gxUnidirectionalMotion = 0;
  278.         gxBidirectionalMotion = 1;
  279.  
  280. { Constants for saveFile field in universal print record }
  281.         gxNoFile = 0;
  282.         gxPostScriptFile = 1;
  283.  
  284. { The format of the "universal" print record }
  285.  
  286.     type
  287.         gxUniversalPrintRecord = record
  288.                 prVersion: INTEGER;                                { Print record version }
  289.         {}
  290. {                                                        prInfo subrecord}
  291. {                                                }
  292.                 appDev: INTEGER;                                { Device kind, always 0 }
  293.                 appVRes: INTEGER;                                { Application vertical resolution }
  294.                 appHRes: INTEGER;                                { Application horizontal resolution }
  295.                 appPage: Rect;                                    { Page size, in application resolution }
  296.                 appPaper: Rect;                                    { Paper rectangle [offset from rPage] }
  297.         {}
  298. {                                                        prStl subrecord}
  299. {                                                }
  300.                 devType: INTEGER;                                { Device type, always 0xA900 (was wDev) }
  301.                 pageV: INTEGER;                                { Page height in 120ths of an inch }
  302.                 pageH: INTEGER;                                { Page width in 120ths of an inch }
  303.                 fillByte: CHAR;                                    { Page calculation mode }
  304.                 feed: CHAR;                                    { Feed mode }
  305.         {}
  306. {                                                        prInfoPT subrecord}
  307. {                                                }
  308.                 devKind: INTEGER;                                { Device kind, always 0 }
  309.                 devVRes: INTEGER;                                { Device vertical resolution }
  310.                 devHRes: INTEGER;                                { Device horizontal resolution }
  311.                 devPage: Rect;                                    { Device page size }
  312.         {}
  313. {                                                        prXInfo subrecord}
  314. {                                                }
  315.                 actualCopies: INTEGER;                                { Actual number of copies for this job }
  316.                 options: INTEGER;                                { Options for this device }
  317.                 reduction: INTEGER;                                { Reduce/enlarge factor }
  318.                 orientation: CHAR;                                    { Orientation of paper ( 0=portrait, 1=landscape ) }
  319.         {}
  320. {                                                        Clusters and PopUps}
  321. {                                                }
  322.                 qualityMode: CHAR;                                    { Quality mode }
  323.                 coverPage: CHAR;                                    { Cover page }
  324.                 firstTray: CHAR;                                    { First feed tray }
  325.                 remainingTray: CHAR;                                    { Remaining feed tray }
  326.                 headMotion: CHAR;                                    { Head motion }
  327.                 saveFile: CHAR;                                    { Save file }
  328.                 userCluster1: CHAR;                                    { Three clusters left over }
  329.                 userCluster2: CHAR;
  330.                 userCluster3: CHAR;
  331.         {}
  332. {                                                        prJob subrecord}
  333. {                                                }
  334.                 firstPage: INTEGER;                                { First page }
  335.                 lastPage: INTEGER;                                { Last page }
  336.                 copies: INTEGER;                                { Number of copies, always 1 }
  337.                 reserved1: CHAR;                                    { Always true, unused }
  338.                 reserved2: CHAR;                                    { Always true, unused }
  339.                 pIdleProc: PrIdleUPP;                                { Idle proc }
  340.                 pFileName: Ptr;                                    { Spool file name pointer }
  341.                 fileVol: INTEGER;                                { Spool file vRefNum }
  342.                 fileVers: CHAR;                                    { File version, must be 0 }
  343.                 reserved3: CHAR;                                    { Always 0 }
  344.                 printX: array[0..18] of INTEGER;                { Internal use }
  345.             end;
  346.  
  347.         gxUniversalPrintRecordPtr = ^gxUniversalPrintRecord;
  348.         gxUniversalPrintRecordHdl = ^gxUniversalPrintRecordPtr;
  349.  
  350. { ------------------------------------------------------------------------------}
  351. {}
  352. {                            Compatibility Printing Messages}
  353. {}
  354. {-------------------------------------------------------------------------------- }
  355.  
  356. {FUNCTION Forward_GXPrOpenDoc(hPrint: THPrint; VAR pPort: TPPrPort): OSErr; C;}
  357. {FUNCTION Forward_GXPrCloseDoc(pPort: TPPrPort): OSErr; C;}
  358. {FUNCTION Forward_GXPrOpenPage(pPort: TPPrPort; pRect: TPRect; resolution: Point): OSErr; C;}
  359. {FUNCTION Forward_GXPrClosePage(pPort: TPPrPort): OSErr; C;}
  360. {FUNCTION Forward_GXPrintDefault(hPrint: THPrint): OSErr; C;}
  361. {FUNCTION Forward_GXPrStlDialog(hPrint: THPrint; VAR confirmed: BOOLEAN): OSErr; C;}
  362. {FUNCTION Forward_GXPrJobDialog(hPrint: THPrint; VAR confirmed: BOOLEAN): OSErr; C;}
  363. {FUNCTION Forward_GXPrStlInit(hPrint: THPrint; VAR pDlg: TPPrDlgRef): OSErr; C;}
  364. {FUNCTION Forward_GXPrJobInit(hPrint: THPrint; VAR pDlg: TPPrDlgRef): OSErr; C;}
  365. {FUNCTION Forward_GXPrDlgMain(hPrint: THPrint; initProc: PDlgInitUPP; VAR confirmed: BOOLEAN): OSErr; C;}
  366. {FUNCTION Forward_GXPrValidate(hPrint: THPrint; VAR changedPrintRecord: BOOLEAN): OSErr; C;}
  367. {FUNCTION Forward_GXPrJobMerge(srcPrint: THPrint; destPrint: THPrint): OSErr; C;}
  368. {FUNCTION Forward_GXPrGeneral(dataPtr: Ptr): OSErr; C;}
  369. {FUNCTION Forward_GXConvertPrintRecordTo(hPrint: THPrint): OSErr; C;}
  370. {FUNCTION Forward_GXConvertPrintRecordFrom(hPrint: THPrint): OSErr; C;}
  371. {FUNCTION Forward_GXPrintRecordToJob(hPrint: THPrint; aJob: gxJob): OSErr; C;}
  372. { ------------------------------------------------------------------------------}
  373. {}
  374. {                        Raster Driver Contants and Types}
  375. {}
  376. {-------------------------------------------------------------------------------- }
  377.  
  378.     type
  379.         gxRasterPlaneOptions = LONGINT;
  380.  
  381. { Input structure for setting up the offscreen }
  382.         gxPlaneSetupRec = record
  383.                 planeOptions: gxRasterPlaneOptions;                    { Options for the offscreen package }
  384.                 planeHalftone: gxHalftone;                                { OPTIONAL: halftone structure for this plane }
  385.                 planeSpace: gxColorSpace;                            { OPTIONAL: noSpace will get the graphics default }
  386.                 planeSet: gxColorSet;                                { OPTIONAL: NIL gets the default }
  387.                 planeProfile: gxColorProfile;                            { OPTIONAL: NIL gets no matching }
  388.             end;
  389.  
  390. { Constants for planeOptions field in gxPlaneSetupRec }
  391.  
  392.     const
  393.         gxDefaultOffscreen = $00000000;                    { Default value - bits are allocated for the client, halftoning takes place }
  394.         gxDontSetHalftone = $00000001;                    { Don't call SetViewPortHalftone }
  395.         gxDotTypeIsDitherLevel = $00000002;                    { Call SetViewPortDither using the dotType as the level }
  396.  
  397.  
  398.     type
  399.         gxOffscreenSetupRec = record
  400.                 width: INTEGER;                                { Width in pixels }
  401.                 minHeight: INTEGER;                                { Minimum height in pixels - actual height returned here }
  402.                 maxHeight: INTEGER;                                { Maximum height in pixels }
  403.                 ramPercentage: Fixed;                                    { Maximum percentage of RAM to take }
  404.                 ramSlop: LONGINT;                                { Amount of RAM to be sure to leave }
  405.                 depth: INTEGER;                                { Depths in bits of each plane }
  406.                 vpMapping: gxMapping;                                { Mapping to assign to offscreen viewPorts }
  407.                 vdMapping: gxMapping;                                { Mapping to assign to offscreen viewDevices }
  408.                 planes: INTEGER;                                { Number of planes to allocate of depth bits each (can be more than 4) }
  409.                 planeSetup: array[0..3] of gxPlaneSetupRec;        { Parameters for each plane, 4 is provided because it is most handy for writers of devices }
  410.             end;
  411.  
  412. { The format of one plane in the offscreen planar area }
  413.         gxOffscreenPlaneRec = record
  414.                 theViewPort: gxViewPort;                                { viewPort for the offscreen }
  415.                 theDevice: gxViewDevice;                            { viewDevice for the offscreen }
  416.                 theViewGroup: gxViewGroup;                            { The viewGroup that they share }
  417.                 theBitmap: gxShape;                                { The offscreen bitmap shape }
  418.                 theBits: gxBitmap;                                { The bits of the offscreen }
  419.             end;
  420.  
  421. { The format of an entire offscreen area }
  422.         gxOffscreenRec = record
  423.                 numberOfPlanes: INTEGER;                                { Number of planes we have }
  424.                 offscreenStorage: Handle;                                    { Handle containing the bitmaps image data }
  425.                 thePlanes: array[0..0] of gxOffscreenPlaneRec;    { Planes to draw in }
  426.             end;
  427.  
  428.         gxOffscreenPtr = ^gxOffscreenRec;
  429.         gxOffscreenHdl = ^gxOffscreenPtr;
  430.  
  431.         gxRasterRenderOptions = LONGINT;
  432.  
  433. { Structure that mirrors 'rdip' resource. }
  434.         gxRasterPrefsRec = record
  435.                 renderOptions: gxRasterRenderOptions;                    { Options for the raster imaging system }
  436.                 hImageRes: Fixed;                                    { Horizontal resolution to image at }
  437.                 vImageRes: Fixed;                                    { Vertical resolution to image at }
  438.                 minBandSize: INTEGER;                                { Minimum band size to use (in pixels) }
  439.                 maxBandSize: INTEGER;                                { Maximum band size to use (in pixels), 0 == entire page }
  440.                 ramPercentage: Fixed;                                    { Maximum percentage of RAM to take }
  441.                 ramSlop: LONGINT;                                { Amount of RAM to be sure to leave }
  442.                 depth: INTEGER;                                { Depth in pixels (PER PLANE!) }
  443.                 numPlanes: INTEGER;                                { Number of planes to render }
  444.                 planeSetup: array[0..0] of gxPlaneSetupRec;        { One for each plane }
  445.             end;
  446.  
  447. { Constants for renderOptions field in gxRasterPrefsRec. }
  448.  
  449.     const
  450.         gxDefaultRaster = $00000000;                    { Default raster options }
  451.         gxDontResolveTransferModes = $00000001;                    { 0=Resolve, 1=Don't Resolve }
  452.         gxRenderInReverse = $00000002;                    { Traverse image in reverse order }
  453.         gxOnePlaneAtATime = $00000004;                    { Render each plane separately }
  454.         gxSendAllBands = $00000008;                    { Send even empty bands }
  455.  
  456.  
  457.     type
  458.         gxRasterPrefsPtr = ^gxRasterPrefsRec;
  459.         gxRasterPrefsHdl = ^gxRasterPrefsPtr;
  460.  
  461.         gxRasterPackageOptions = LONGINT;
  462.  
  463. { Structure that mirrors 'rpck' resource. }
  464.         gxRasterPackageRec = record
  465.                 bufferSize: Ptr;                                    { Buffer size for packaging (>= maximum head pass size) }
  466.                 colorPasses: INTEGER;                                { 1 (b/w) or 4 (CMYK) is typical }
  467.                 headHeight: INTEGER;                                { Printhead height in pixels }
  468.                 numberPasses: INTEGER;                                { Number of head passes it takes to == iHeadHeight }
  469.                 passOffset: INTEGER;                                { Offset between passes, in pixels }
  470.                 packageOptions: gxRasterPackageOptions;                    { Packaging options }
  471.             end;
  472.  
  473.         gxRasterPackagePtr = ^gxRasterPackageRec;
  474.         gxRasterPackageHdl = ^gxRasterPackagePtr;
  475.  
  476. { Constants for packageOptions field in gxRasterPackageRec. }
  477.  
  478.     const
  479.         gxSendAllColors = $00000001;                    { Send even clean bands through }
  480.         gxInterlaceColor = $00000002;                    { Ribbon contamination is a concern }
  481.         gxOverlayColor = $00000004;                    { Color printer without a ribbon problem }
  482.         gxUseColor = $6; { This is a color printer }
  483.  
  484. { Structure for RasterPackageBitmap message }
  485.  
  486.     type
  487.         gxRasterPackageBitmapRec = record
  488.                 bitmapToPackage: ^gxBitmap;                                { Bitmap containing the data to package }
  489.                 startRaster: INTEGER;                                { Raster to begin the packaging from }
  490.                 colorBand: INTEGER;                                { For which color pass this is a packaging request }
  491.                 isBandDirty: BOOLEAN;                                { Whether there are any dirty bits in this band }
  492.                 padByte: CHAR;
  493.                 dirtyRect: Rect;                                    { Which bits are dirty }
  494.             end;
  495.  
  496. { Structure of number record in gxRasterPackageControlsRec }
  497.         gxStandardNumberRec = record
  498.                 numberType: INTEGER;                                { Type of numberic output desired }
  499.                 minWidth: INTEGER;                                { Minimum output width of the number }
  500.                 padChar: CHAR;                                    { Pad character for numbers shorter than the minWidth }
  501.                 padChar2: CHAR;
  502.                 startString: Str31;                                    { Prefix string }
  503.                 endString: Str31;                                    { Postfix string }
  504.             end;
  505.  
  506.         gxStandardNumberPtr = ^gxStandardNumberRec;
  507.  
  508. { Structure that mirrors 'ropt' resource }
  509.         gxRasterPackageControlsRec = record
  510.                 startPageStringID: INTEGER;                                { 'wstr' to send to the device at start of page }
  511.                 formFeedStringID: INTEGER;                                { 'wstr' to send to the device to cause a form feed }
  512.                 forwardMax: INTEGER;                                { Line feed strings }
  513.                 forwardLineFeed: gxStandardNumberRec;                    { Number record for forward line feed }
  514.                 reverseMax: INTEGER;                                { Max number of reverse line feeds device can do }
  515.                 reverseLineFeed: gxStandardNumberRec;                    { Number record for forward line feed }
  516.             end;
  517.  
  518.         gxRasterPackageControlsPtr = ^gxRasterPackageControlsRec;
  519.         gxRasterPackageControlsHdl = ^gxRasterPackageControlsPtr;
  520.  
  521. { Raster imaging system imageData structure }
  522.         gxRasterImageDataRec = record
  523.                 renderOptions: gxRasterRenderOptions;                    { Options for the raster imaging system }
  524.                 hImageRes: Fixed;                                    { horizontal resolution to image at }
  525.                 vImageRes: Fixed;                                    { vertical resolution to image at }
  526.                 minBandSize: INTEGER;                                { smallest band that makes sense for this device }
  527.                 maxBandSize: INTEGER;                                { biggest band that makes sense, or 0 for "full page" }
  528.                 pageSize: gxRectangle;                            { size of page for device }
  529.         {}
  530. {            Values used within the RasterDataIn message}
  531. {    }
  532.                 currentYPos: INTEGER;                                { Current position moving down the page }
  533.                 packagingInfo: gxRasterPackageRec;                        { Raster packaging record }
  534.         {}
  535. {            Values used within the remaining messages}
  536. {    }
  537.                 optionsValid: BOOLEAN;                                { Were options specified by the driver? }
  538.                 padByte: CHAR;
  539.                 packageControls: gxRasterPackageControlsRec;                { Options for the packaging messages }
  540.                 theSetup: gxOffscreenSetupRec;                    { setup for the offscreen code, variable length componant }
  541.             end;
  542.  
  543.         gxRasterImageDataPtr = ^gxRasterImageDataRec;
  544.         gxRasterImageDataHdl = ^gxRasterImageDataPtr;
  545.  
  546. { ------------------------------------------------------------------------------}
  547. {}
  548. {                                Raster Driver Imaging Messages}
  549. {}
  550. {-------------------------------------------------------------------------------- }
  551.  
  552. {FUNCTION Send_GXRasterDataIn(offScreen: gxOffscreenHdl; VAR bandRectangle: gxRectangle; VAR dirtyRectangle: gxRectangle): OSErr; C;}
  553. {FUNCTION Forward_GXRasterDataIn(offScreen: gxOffscreenHdl; VAR bandRectangle: gxRectangle; VAR dirtyRectangle: gxRectangle): OSErr; C;}
  554. {FUNCTION Send_GXRasterLineFeed(VAR lineFeedSize: LONGINT; buffer: Ptr; VAR bufferPos: LONGINT; imageDataHdl: gxRasterImageDataHdl): OSErr; C;}
  555. {FUNCTION Forward_GXRasterLineFeed(VAR lineFeedSize: LONGINT; buffer: Ptr; VAR bufferPos: LONGINT; imageDataHdl: gxRasterImageDataHdl): OSErr; C;}
  556. {FUNCTION Send_GXRasterPackageBitmap(VAR whatToPackage: gxRasterPackageBitmapRec; buffer: Ptr; VAR bufferPos: LONGINT; imageDataHdl: gxRasterImageDataHdl): OSErr; C;}
  557. {FUNCTION Forward_GXRasterPackageBitmap(VAR whatToPackage: gxRasterPackageBitmapRec; buffer: Ptr; VAR bufferPos: LONGINT; imageDataHdl: gxRasterImageDataHdl): OSErr; C;}
  558. { ------------------------------------------------------------------------------}
  559. {}
  560. {                        Vector Driver Contants and Types}
  561. {}
  562. {-------------------------------------------------------------------------------- }
  563. { Vector device halftone component record }
  564.  
  565.     type
  566.         gxVHalftoneCompRec = record
  567.                 angle: Fixed;                                    { Angle to halftone at. Must be 0, 90, 45 or 135 }
  568.                 penIndex: LONGINT;                                { index of the pen to draw this component with }
  569.             end;
  570.  
  571. { Vector device halftone record }
  572.         gxVHalftoneRec = record
  573.                 halftoneSpace: gxColorSpace;
  574.                 halftoneComps: array[0..3] of gxVHalftoneCompRec;        { Info for each color component }
  575.                 penIndexForBW: LONGINT;                                { Pen index to draw one bit deep or black and white bitmap with }
  576.             end;
  577.  
  578. { Vector shape rendering information }
  579.         gxVectorShapeOptions = LONGINT;
  580.  
  581.         gxVectorShapeDataRec = record
  582.                 shapeOptions: gxVectorShapeOptions;                    { Options to control shape handling }
  583.                 maxPolyPoints: LONGINT;                                { Maximum number of polygon points that device can support }
  584.                 shapeError: Fixed;                                    { Defines allowed deviation from the original shape }
  585.                 textSize: Fixed;                                    { Text above this size is filled; text below this size is outlined }
  586.                 frameSize: Fixed;                                    { Frame's smaller than this -> shape stroked; frame's larger -> shape is filled }
  587.             end;
  588.  
  589. { Constants for shapeOptions field in gxVectorShapeDataRec. }
  590.  
  591.     const
  592.         gxUnidirectionalFill = $00000001;                    { Generate scanlines in one direction only.  Useful for transparencies }
  593.         gxAlsoOutlineFilledShape = $00000002;                    { Turn on this bit to also outline solid filled shapes }
  594.  
  595. { Vector device rendering information }
  596.  
  597.     type
  598.         gxVectorRenderOptions = LONGINT;
  599.  
  600. { Vector imaging system imageData structure }
  601.         gxVectorImageDataRec = record
  602.                 renderOptions: gxVectorRenderOptions;                    { Options to control rendering: color sort, clipping, etc. }
  603.                 devRes: Fixed;                                    { Device resolution }
  604.                 devTransform: gxTransform;                            { Mapping, clip and halftoning information for colored bitmaps }
  605.                 clrSet: gxColorSet;                                { Entire set of colors; usually indexed color space for pen plotters }
  606.                 bgColor: gxColor;                                { The background color in the color space specified by the clrSpace field }
  607.                 halftoneInfo: gxVHalftoneRec;                            { Defines halftone information for color bitmaps }
  608.                 hPenTable: gxPenTableHdl;                            { Complete list of pens along with their pen positions and thickness }
  609.                 pageRect: gxRectangle;                            { Page dimensions }
  610.                 shapeData: gxVectorShapeDataRec;                    { Information on how to render a shape }
  611.             end;
  612.  
  613.         gxVectorImageDataPtr = ^gxVectorImageDataRec;
  614.         gxVectorImageDataHdl = ^gxVectorImageDataPtr;
  615.  
  616. { Constants for renderOptions field in gxVectorImageDataRec. }
  617.  
  618.     const
  619.         gxColorSort = $00000001;                    { Set for pen plotters }
  620.         gxATransferMode = $00000002;                    { Set if transfer modes need to be resolved }
  621.         gxNoOverlap = $00000004;                    { Set if non-overlapping output is desired}
  622.         gxAColorBitmap = $00000008;                    { Set if color bitmap output is desired }
  623.         gxSortbyPenPos = $00000010;                    { Set if shapes are to be drawn in the order of the pen index }
  624. { in the pen table. NOTE: this is not the pen position in the carousel }
  625.         gxPenLessPlotter = $00000020;                    { Indicates raster printer/plotter }
  626.         gxCutterPlotter = $00000040;                    { Indicates cutter }
  627.         gxNoBackGround = $00000080;                    { Set if shapes that map to the background color should not be sent to driver }
  628.  
  629. { ------------------------------------------------------------------------------}
  630. {}
  631. {                                Vector Driver Imaging Messages}
  632. {}
  633. {-------------------------------------------------------------------------------- }
  634.  
  635. {FUNCTION Send_GXVectorPackageShape(theShape: gxShape; penIndex: LONGINT): OSErr; C;}
  636. {FUNCTION Forward_GXVectorPackageShape(theShape: gxShape; penIndex: LONGINT): OSErr; C;}
  637. {FUNCTION Send_GXVectorLoadPens(penTable: gxPenTableHdl; VAR shapeCounts: LONGINT; VAR penTableChanged: BOOLEAN): OSErr; C;}
  638. {FUNCTION Forward_GXVectorLoadPens(penTable: gxPenTableHdl; VAR shapeCounts: LONGINT; VAR penTableChanged: BOOLEAN): OSErr; C;}
  639. {FUNCTION Send_GXVectorVectorizeShape(theShape: gxShape; penIndex: LONGINT; VAR vectorData: gxVectorShapeDataRec): OSErr; C;}
  640. {FUNCTION Forward_GXVectorVectorizeShape(theShape: gxShape; penIndex: LONGINT; VAR vectorData: gxVectorShapeDataRec): OSErr; C;}
  641. { ------------------------------------------------------------------------------}
  642. {}
  643. {                            PostScript Driver Contants and Types}
  644. {}
  645. {-------------------------------------------------------------------------------- }
  646.  
  647.     const
  648.         gxPostSynonym = 'post';
  649.  
  650. { PostScript glyphs record }
  651.  
  652.     type
  653.         gxPrinterGlyphsRec = record
  654.                 theFont: gxFont;                                    {  ---> Font reference }
  655.                 nGlyphs: LONGINT;                                {  ---> Number of glyphs in the font }
  656.                 platform: gxFontPlatform;                            { <---  How printer font is encoded }
  657.                 script: gxFontScript;                            { <---  Script if platform != glyphPlatform }
  658.                 language: gxFontLanguage;                            { <---  Language if platform != glyphPlatform }
  659.                 vmUsage: LONGINT;                                { <---  How much PostScript VM font uses }
  660.         { Size of this array is long-alligned(nGlyphs) }
  661.                 glyphBits: array[0..0] of LONGINT;                { <---  Bit array of which system glyphs are in printer }
  662.             end;
  663.  
  664. { PostScript device rendering information }
  665.         gxPostScriptRenderOptions = LONGINT;
  666.  
  667.         gxPostScriptImageDataRec = record
  668.                 languageLevel: INTEGER;                                { PostScript language level }
  669.                 devCSpace: gxColorSpace;                            { The printer's color space }
  670.                 devCProfile: gxColorProfile;                            { The printer's color profile for matching }
  671.                 renderOptions: gxPostScriptRenderOptions;                { Options for the imaging system }
  672.                 pathLimit: LONGINT;                                { Maximum path size }
  673.                 gsaveLimit: INTEGER;                                { Maximum number of gsaves allowed }
  674.                 opStackLimit: INTEGER;                                { Operand stack limit }
  675.                 fontType: scalerStreamTypeFlag;                    { These are the font types that the printer supports  }
  676.                 printerVM: LONGINT;                                { How much memory is in the printer }
  677.                 reserved0: LONGINT;
  678.             end;
  679.  
  680.         gxPostScriptImageDataPtr = ^gxPostScriptImageDataRec;
  681.         gxPostScriptImageDataHdl = ^gxPostScriptImageDataPtr;
  682.  
  683. { Constants for renderOptions field in gxPostScriptImageDataRec. }
  684.  
  685.     const
  686.         gxNeedsHexOption = $00000001;                    { Convert all binary data to hex }
  687.         gxNeedsCommentsOption = $00000002;                    { Issue PostScript comments }
  688.         gxBoundingBoxesOption = $00000004;                    { Calculate the values for %%BoundingBox: and %%PageBoundingBox: -- requires needsCommentsOption }
  689.         gxPortablePostScriptOption = $00000008;                    { Generate portable PostScript }
  690.         gxTextClipsToPathOption = $00000010;                    { Convert all clips that are composed of text to path shapes }
  691.         gxFlattenClipPathOption = $00000020;                    { Convert all clips that are path shapes to polygons (helps better control point limit) }
  692.         gxUseCharpath1Option = $00000040;                    { (ignored if text clips are converted to paths)  When the clip is text,  }
  693. { Do it one glyph at a time, redrawing the main shape each time }
  694.         gxUseLevel2ColorOption = $00000080;                    { When printing to level-2 use level-2 device independent color }
  695.         gxNoEPSIllegalOperators = $00000100;                    { Don't use any operators prohibited by the Encapsulated PostScript File Format V3.0 }
  696.         gxEPSTargetOption = $106; { PostScript intended for EPS Use. }
  697.  
  698. { Structure for gxPostScriptGetProcSetList / gxPostScriptDownLoadProcSetList }
  699.  
  700.     type
  701.         gxProcSetListRec = record
  702.                 clientid: gxOwnerSignature;
  703.                 controlType: OSType;                                    { The driver will call FetchTaggedData on each of these resources }
  704.                 controlid: INTEGER;
  705.                 dataType: OSType;
  706.                 reserved0: LONGINT;
  707.             end;
  708.  
  709.         gxProcSetListPtr = ^gxProcSetListRec;
  710.         gxProcSetListHdl = ^gxProcSetListPtr;
  711.  
  712. { Possible results of querying printer (returned by gxPostScriptQueryPrinter message) }
  713.  
  714.     const
  715.         gxPrinterOK = 0;
  716.         gxIntializePrinter = 1;
  717.         gxFilePrinting = 2;
  718.         gxResetPrinter = 128;
  719.  
  720. { ------------------------------------------------------------------------------}
  721. {}
  722. {                                PostScript Driver Imaging Messages}
  723. {}
  724. {-------------------------------------------------------------------------------- }
  725.  
  726. {FUNCTION Send_GXPostScriptQueryPrinter(VAR queryData: LONGINT): OSErr; C;}
  727. {FUNCTION Forward_GXPostScriptQueryPrinter(VAR queryData: LONGINT): OSErr; C;}
  728. {FUNCTION Send_GXPostScriptInitializePrinter: OSErr; C;}
  729. {FUNCTION Forward_GXPostScriptInitializePrinter: OSErr; C;}
  730. {FUNCTION Send_GXPostScriptResetPrinter: OSErr; C;}
  731. {FUNCTION Forward_GXPostScriptResetPrinter: OSErr; C;}
  732. {FUNCTION Send_GXPostScriptExitServer: OSErr; C;}
  733. {FUNCTION Forward_GXPostScriptExitServer: OSErr; C;}
  734. {}
  735. {}
  736. {        Device communication messages}
  737. {}
  738. {}
  739. {FUNCTION Send_GXPostScriptGetStatusText(textHdl: Handle): OSErr; C;}
  740. {FUNCTION Forward_GXPostScriptGetStatusText(textHdl: Handle): OSErr; C;}
  741. {FUNCTION Send_GXPostScriptGetPrinterText(textHdl: Handle): OSErr; C;}
  742. {FUNCTION Forward_GXPostScriptGetPrinterText(textHdl: Handle): OSErr; C;}
  743. {FUNCTION Send_GXPostScriptScanStatusText(textHdl: Handle): OSErr; C;}
  744. {FUNCTION Forward_GXPostScriptScanStatusText(textHdl: Handle): OSErr; C;}
  745. {FUNCTION Send_GXPostScriptScanPrinterText(textHdl: Handle): OSErr; C;}
  746. {FUNCTION Forward_GXPostScriptScanPrinterText(textHdl: Handle): OSErr; C;}
  747. {}
  748. {}
  749. {        Proc set management messages}
  750. {}
  751. {}
  752. {FUNCTION Send_GXPostScriptGetDocumentProcSetList(procSet: gxProcSetListHdl; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  753. {FUNCTION Forward_GXPostScriptGetDocumentProcSetList(procSet: gxProcSetListHdl; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  754. {FUNCTION Send_GXPostScriptDownloadProcSetList(procSet: gxProcSetListHdl; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  755. {FUNCTION Forward_GXPostScriptDownloadProcSetList(procSet: gxProcSetListHdl; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  756. {}
  757. {}
  758. {        Font management messages}
  759. {}
  760. {}
  761. {FUNCTION Send_GXPostScriptGetPrinterGlyphsInformation(VAR glyphsInfo: gxPrinterGlyphsRec): OSErr; C;}
  762. {FUNCTION Forward_GXPostScriptGetPrinterGlyphsInformation(VAR glyphsInfo: gxPrinterGlyphsRec): OSErr; C;}
  763. {FUNCTION Send_GXPostScriptStreamFont(fontref: gxFont; VAR streamPtr: scalerStream): OSErr; C;}
  764. {FUNCTION Forward_GXPostScriptStreamFont(fontref: gxFont; VAR streamPtr: scalerStream): OSErr; C;}
  765. {}
  766. {}
  767. {        Document structuring and formatting messages}
  768. {}
  769. {}
  770. {FUNCTION Send_GXPostScriptDoDocumentHeader(imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  771. {FUNCTION Forward_GXPostScriptDoDocumentHeader(imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  772. {FUNCTION Send_GXPostScriptDoDocumentSetup(imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  773. {FUNCTION Forward_GXPostScriptDoDocumentSetup(imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  774. {FUNCTION Send_GXPostScriptDoDocumentTrailer(imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  775. {FUNCTION Forward_GXPostScriptDoDocumentTrailer(imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  776. {}
  777. {}
  778. {        Page structuring and formatting messages}
  779. {}
  780. {}
  781. {FUNCTION Send_GXPostScriptDoPageSetup(pageFormat: gxFormat; thePage: LONGINT; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  782. {FUNCTION Forward_GXPostScriptDoPageSetup(pageFormat: gxFormat; thePage: LONGINT; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  783. {FUNCTION Send_GXPostScriptSelectPaperType(thePapertype: gxPaperType; thePage: LONGINT; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  784. {FUNCTION Forward_GXPostScriptSelectPaperType(thePapertype: gxPaperType; thePage: LONGINT; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  785. {FUNCTION Send_GXPostScriptDoPageTrailer(imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  786. {FUNCTION Forward_GXPostScriptDoPageTrailer(imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  787. {FUNCTION Send_GXPostScriptEjectPage(thePapertype: gxPaperType; pagenumber: LONGINT; copiescount: LONGINT; erasepage: LONGINT; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  788. {FUNCTION Forward_GXPostScriptEjectPage(thePapertype: gxPaperType; pagenumber: LONGINT; copiescount: LONGINT; erasepage: LONGINT; imageDataHdl: gxPostScriptImageDataHdl): OSErr; C;}
  789. {FUNCTION Send_GXPostScriptEjectPendingPage(VAR pageWasEjected: BOOLEAN): OSErr; C;}
  790. {FUNCTION Forward_GXPostScriptEjectPendingPage(VAR pageWasEjected: BOOLEAN): OSErr; C;}
  791. {}
  792. {}
  793. {        Shape imaging messages}
  794. {}
  795. {}
  796. {FUNCTION Send_GXPostScriptProcessShape(page: gxShape; trcount: LONGINT; trlist: gxTransform): OSErr; C;}
  797. {FUNCTION Forward_GXPostScriptProcessShape(page: gxShape; trcount: LONGINT; trlist: gxTransform): OSErr; C;}
  798. { ------------------------------------------------------------------------------}
  799. {}
  800. {                                            Driver API Functions}
  801. {}
  802. {-------------------------------------------------------------------------------- }
  803.  
  804.     const
  805.         gxMissingImagePointer = -4;
  806.  
  807.  
  808. {FUNCTION GXAddPrinterViewDevice(thePrinter: gxPrinter; theViewDevice: gxViewDevice): OSErr; C;}
  809. {FUNCTION GXGetAvailableJobFormatModes(VAR theFormatModes: gxJobFormatModeTableHdl): OSErr; C;}
  810. {FUNCTION GXSetPreferredJobFormatMode(theFormatMode: gxJobFormatMode; directOnly: BOOLEAN): OSErr; C;}
  811. {FUNCTION GXPrintingAlert(iconId: LONGINT; txtSize: LONGINT; defaultTitleNum: LONGINT; cancelTitleNum: LONGINT; textLength: LONGINT; pAlertMsg: Ptr; actionTitle: StringPtr; title2: StringPtr; title3: StringPtr; msgFont: StringPtr; filterProc: ModalFil}
  812. {terUPP; VAR itemHit: INTEGER; alertTitle: StringPtr): OSErr; C;}
  813. {FUNCTION GXGetPrintingAlert(alertResId: LONGINT; filterProc: ModalFilterUPP; VAR itemHit: INTEGER): OSErr; C;}
  814. {FUNCTION GXFetchDTPData(VAR dtpName: Str31; theType: OSType; theID: LONGINT; VAR theData: Handle): OSErr; C;}
  815. {FUNCTION GXWriteDTPData(VAR dtpName: Str31; theType: OSType; theID: LONGINT; theData: Handle): OSErr; C;}
  816. {FUNCTION GXHandleChooserMessage(VAR aJob: gxJob; VAR driverName: Str31; message: LONGINT; caller: LONGINT; objName: StringPtr; zoneName: StringPtr; theList: ListHandle; p2: LONGINT): OSErr; C;}
  817.  
  818. { $ALIGN RESET}
  819. { $POP}
  820.  
  821. {$ENDC}
  822.  {__GXPRINTERDRIVERS__}
  823.  
  824. implementation
  825. end.
  826.